OpenStack Ocata : Configure Nova#2
2017/02/27 |
Install OpenStack Compute Service (Nova).
This example is based on the emvironment like follows.
eth0|10.0.0.30 +-----------+-----------+ | [ Control Node ] | | | | MariaDB RabbitMQ | | Memcached httpd | | Keystone Glance | | Nova API | +-----------------------+ |
[1] | Install Nova services. |
[root@dlp ~(keystone)]# yum --enablerepo=centos-openstack-ocata,epel -y install openstack-nova
|
[2] | Configure Nova. |
[root@dlp ~(keystone)]# mv /etc/nova/nova.conf /etc/nova/nova.conf.org
[root@dlp ~(keystone)]#
vi /etc/nova/nova.conf # create new [DEFAULT] # define own IP my_ip = 10.0.0.30 state_path = /var/lib/nova enabled_apis = osapi_compute,metadata log_dir = /var/log/nova # RabbitMQ connection info transport_url = rabbit://openstack:password@10.0.0.30 [api] auth_strategy = keystone # Glance connection info [glance] api_servers = http://10.0.0.30:9292 [oslo_concurrency] lock_path = $state_path/tmp # MariaDB connection info [api_database] connection = mysql+pymysql://nova:password@10.0.0.30/nova_api [database] connection = mysql+pymysql://nova:password@10.0.0.30/nova # Keystone auth info [keystone_authtoken] auth_uri = http://10.0.0.30:5000 auth_url = http://10.0.0.30:35357 memcached_servers = 10.0.0.30:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = nova password = servicepassword [placement] auth_url = http://10.0.0.30:35357 os_region_name = RegionOne auth_type = password project_domain_name = default user_domain_name = default project_name = service username = placement password = servicepassword [placement_database] connection = mysql+pymysql://nova:password@10.0.0.30/nova_placement [wsgi] api_paste_config = /etc/nova/api-paste.ini chmod 640 /etc/nova/nova.conf [root@dlp ~(keystone)]# chgrp nova /etc/nova/nova.conf
[root@dlp ~(keystone)]#
vi /etc/httpd/conf.d/00-nova-placement-api.conf # add near line 15 <Directory /usr/bin> Require all granted </Directory> |
[3] | If SELinux is enabled, change policy like follows. |
[root@dlp ~(keystone)]# semanage port -a -t http_port_t -p tcp 8778
[root@dlp ~(keystone)]#
vi nova-api_pol.te # create new module nova-api_pol 1.0; require { type nova_t; type httpd_config_t; type httpd_t; type nova_log_t; type sysctl_net_t; type netutils_exec_t; class file { read getattr create open execute }; class dir { write search add_name }; class capability { kill sys_ptrace }; class capability2 block_suspend; } #============= httpd_t ============== allow httpd_t nova_log_t:dir { write add_name }; allow httpd_t nova_log_t:file { create open }; #============= nova_t ============== allow nova_t httpd_config_t:dir search; allow nova_t netutils_exec_t:file execute; allow nova_t self:capability kill; allow nova_t sysctl_net_t:dir search; allow nova_t sysctl_net_t:file { read getattr open }; allow nova_t self:capability sys_ptrace; allow nova_t self:capability2 block_suspend; checkmodule -m -M -o nova-api_pol.mod nova-api_pol.te checkmodule: loading policy configuration from nova-api_pol.te checkmodule: policy configuration loaded checkmodule: writing binary representation (version 17) to nova-api_pol.mod [root@dlp ~(keystone)]# semodule_package --outfile nova-api_pol.pp --module nova-api_pol.mod [root@dlp ~(keystone)]# semodule -i nova-api_pol.pp |
[4] | If Firewalld is running, allow ports for services. |
[root@dlp ~(keystone)]# firewall-cmd --add-port={6080/tcp,8774/tcp,8775/tcp,8778/tcp} --permanent success [root@dlp ~(keystone)]# firewall-cmd --reload success |
[5] | Add Data into Database and start Nova services. It doesn't need to care the messages "deprecated ***" when sync DB. |
[root@dlp ~(keystone)]#
su -s /bin/bash nova -c "nova-manage api_db sync"
[root@dlp ~(keystone)]#
su -s /bin/bash nova -c "nova-manage cell_v2 map_cell0 \
--database_connection mysql+pymysql://nova:password@10.0.0.30/nova_cell0"
[root@dlp ~(keystone)]#
su -s /bin/bash nova -c "nova-manage db sync"
[root@dlp ~(keystone)]#
su -s /bin/bash nova -c "nova-manage cell_v2 create_cell --name cell1 \
--database_connection mysql+pymysql://nova:password@10.0.0.30/nova \ --transport-url rabbit://openstack:password@10.0.0.30:5672"
[root@dlp ~(keystone)]#
systemctl restart httpd [root@dlp ~(keystone)]# chown nova. /var/log/nova/nova-placement-api.log
[root@dlp ~(keystone)]#
for service in api cert consoleauth conductor scheduler novncproxy; do
systemctl start openstack-nova-$service systemctl enable openstack-nova-$service done # show status [root@dlp ~(keystone)]# openstack compute service list +----+------------------+---------------+----------+---------+-------+----------------------------+ | ID | Binary | Host | Zone | Status | State | Updated At | +----+------------------+---------------+----------+---------+-------+----------------------------+ | 5 | nova-cert | dlp.srv.world | internal | enabled | up | 2017-02-28T03:50:39.000000 | | 6 | nova-consoleauth | dlp.srv.world | internal | enabled | up | 2017-02-28T03:50:32.000000 | | 7 | nova-conductor | dlp.srv.world | internal | enabled | up | 2017-02-28T03:50:34.000000 | | 8 | nova-scheduler | dlp.srv.world | internal | enabled | up | 2017-02-28T03:50:37.000000 | +----+------------------+---------------+----------+---------+-------+----------------------------+ |